#include "thread.h"

int makeTaskQueue(taskQueue_t * queue){
    bzero(queue,sizeof(taskQueue_t));
    return 0;
}

int enQueue(taskQueue_t * queue,int netfd){
    node_t *newNode=(node_t*)malloc(sizeof(node_t));
    newNode->netfd=netfd;
    newNode->pNext=NULL;
    if(queue->size==0){
        queue->pFront=newNode;
        queue->pRear=newNode;
    }
    queue->pRear->pNext=newNode;
    queue->pRear=newNode;
    queue->size++;
    return 0;
}

int outQueue(taskQueue_t * queue){
    node_t* tmep=queue->pFront;
    free(queue->pFront);
    queue->pFront=tmep;
    if(queue->size==1){
        queue->pRear=NULL;
    }
    queue->size--;
    return 0;
}
